open BUFF,"maintop8000.txt" or die "no file exists\n";
$k=0;
while($line=<BUFF>)
{
	chomp($line);
	#print $line."\n";
	#if($k%20==0)
	#{
		if(exists($hash{$line}))
		{
		 	$hash{$line}++;
		}
		else
		{
			$hash{$line} =1;
		}
	#}
	$k++;
}
$n = 0;
 foreach $key (sort { $hash{$b} <=> $hash{$a} } keys %hash) {
        #printf "%4d %s\n", $hash{$key}, $key;
    #}
#while(($key,$value)= each %hash)
#{
	print $key."\t".$hash{$key}."\n";
	$n = $n+$hash{$key};
}
print $n."\n";
